rm(list=ls())

pacman::p_load(lubridate, tidyverse, haven, gtrendsR, rdrobust, rddtools,
               broom, ggpubr, gridExtra, dmetar, meta)

setwd('put_your_wd_here')

# shootings
allshootings <- read_csv('datasets/list_of_shootings.csv',col_select = 1:4)
allshootings$date <- mdy(allshootings$date)

# change petition
df <- read_csv('datasets/change_petition_anisha.csv')
df$date <- lubridate::mdy(df$date)
df <- df %>% filter(country == 'US')

# date range
mindate <- min(df$date) + months(2)
maxdate <- max(df$date) - months(2)
dates <- allshootings %>%
  filter(date >= mindate & date <= maxdate & include==1)

grouped <- df %>%
  group_by(date) %>%
  count() 
grouped <- right_join(grouped, data.frame(date=seq(min(grouped$date), max(grouped$date),by='day')))

dat <- vector('list', nrow(dates))
for(i in 1:length(dat)){
  dat[[i]] <- grouped %>%
    filter(date > dates$date[i] - months(2) & date < dates$date[i] + months(2)) %>%
    mutate(running_day = as.numeric(date - dates$date[i])) 
}

runRdit <- function(out, name){
  sd_est <- sd(out$n,na.rm=T)
  house_rdd <- rdd_data(y=out$n, x=out$running_day, cutpoint=0)
  bw_ik <- rdd_bw_ik(house_rdd)
  reg_nonpara <- rdd_reg_np(rdd_object=house_rdd, bw=bw_ik)
  fullest <- data.frame(Coef=reg_nonpara$coefficients/sd_est,
                        lower=(reg_nonpara$coefficients - 1.96 * reg_nonpara$coefMat[2])/sd_est,
                        upper=(reg_nonpara$coefficients + 1.96 * reg_nonpara$coefMat[2])/sd_est,
                        shooting=name)
  return(fullest)
}

model_results <- vector('list', nrow(dates))
for(i in 1:length(model_results)){
  model_results[[i]] <- runRdit(dat[[i]], dates$shooting[[i]])
}
model_results <- bind_rows(model_results) %>% 
  mutate(outcome = 'Gun Control Petition', petition = 'Common Sense Gun Control') %>%
  remove_rownames()

df <- read_csv('datasets/md_petition.csv')
df$date <- lubridate::mdy(df$date)
df <- df %>% filter(country == 'US')

df <- df %>%
  group_by(date) %>%
  count()
df <- right_join(df, data.frame(date=seq(min(df$date), max(df$date), by='day')))
df$n[is.na(df$n)] <- 0

mindate <- min(df$date) + months(2)
maxdate <- max(df$date) - months(2)
dates <- allshootings %>%
  filter(date >= mindate & date <= maxdate & include==1)

dat <- vector('list', nrow(dates))
for(i in 1:length(dat)){
  dat[[i]] <- df %>%
    filter(date > dates$date[i] - months(2) & date < dates$date[i] + months(2)) %>%
    mutate(running_day = as.numeric(date - dates$date[i])) 
}

model_results2 <- vector('list', nrow(dates))
for(i in 1:length(model_results2)){
  model_results2[[i]] <- runRdit(dat[[i]], dates$shooting[[i]])
}
model_results2 <- bind_rows(model_results2) %>% 
  mutate(outcome = 'Gun Rights Petition', petition = 'Maryland Gun Laws') %>%
  remove_rownames()

df <- read_csv('datasets/change_petition_walmart.csv')
df$date <- lubridate::mdy(df$date)
df <- df %>% filter(country == 'US')

df <- df %>%
  group_by(date) %>%
  count() 
df <- right_join(df, data.frame(date=seq(min(df$date), max(df$date),by='day')))

mindate <- min(df$date) + months(2)
maxdate <- max(df$date) - months(2)
dates <- allshootings %>%
  filter(date >= mindate & date <= maxdate & include==1)

dat <- vector('list', nrow(dates))
for(i in 1:length(dat)){
  dat[[i]] <- df %>%
    filter(date > dates$date[i] - months(2) & date < dates$date[i] + months(2)) %>%
    mutate(running_day = as.numeric(date - dates$date[i])) 
}

model_results3 <- vector('list', nrow(dates))
for(i in 1:length(model_results3)){
  model_results3[[i]] <- runRdit(dat[[i]], dates$shooting[[i]])
}
model_results3 <- bind_rows(model_results3) %>% 
  mutate(outcome = 'Gun Control Petition', petition = 'Walmart Guns') %>% 
  remove_rownames()

# Gun rights 2 ----
df <- read_csv('datasets/signatures_patriot_voices.csv')

df <- df %>%
  group_by(signature) %>%
  count() %>%
  rename(date = signature)
df <- right_join(df, data.frame(date=seq(min(df$date), max(df$date),by='day')))
df$n[is.na(df$n)] <- 0

mindate <- min(df$date) + months(2)
maxdate <- max(df$date) - months(2)
dates <- allshootings %>%
  filter(date >= mindate & date <= maxdate & include==1)

dat <- vector('list', nrow(dates))
for(i in 1:length(dat)){
  dat[[i]] <- df %>%
    filter(date > dates$date[i] - months(2) & date < dates$date[i] + months(2)) %>%
    mutate(running_day = as.numeric(date - dates$date[i])) 
}

vals <- c(1, 2, 3, 5, 6, 10, 13, 14, 16, 17, 18)
model_results4 <- vector('list', length(vals))
for(i in 1:length(vals)){
  model_results4[[i]] <- runRdit(dat[[vals[i]]], dates$shooting[[vals[i]]])
}

model_results4 <- bind_rows(model_results4) %>% 
  mutate(outcome = 'Gun Rights Petition', petition = "Patriot's Voice") %>% 
  remove_rownames()

# Physicians for gun control ----
df <- readxl::read_excel('datasets/petition_signatures_emma taylor.xlsx')
df <- janitor::clean_names(df)
df$date <- ymd(df$signed_on)
df <- df %>% filter(country == 'US')

df <- df %>%
  dplyr::select(date) %>%
  group_by(date) %>%
  count()

date_range <- range(df$date, na.rm=T)

formerge <- expand.grid(date=seq(date_range[1],date_range[2], by='day'))
df <- left_join(formerge, df, by=c('date'))
df$n[is.na(df$n)] <- 0

mindate <- min(df$date) + months(2)
maxdate <- max(df$date) - months(2)
dates <- allshootings %>%
  filter(date >= mindate & date <= maxdate & include==1)

dat_out <- vector('list', nrow(dates))

for(i in 1:nrow(dates)){
  dat_out[[i]] <- df %>%
    filter(date > dates$date[i] - months(2) & date < dates$date[i] + months(2)) %>%
    mutate(running_day = as.numeric(date - dates$date[i]))
  print(i)
}
model_results5 <- vector('list',length(dates$shooting))
for(i in 1:length(dates$shooting)){
  model_results5[[i]] <- tryCatch({runRdit(dat_out[[i]], dates$shooting[[i]])}, 
                                  error=function(e){return(NA)})
  print(i)
}

model_results5[[3]] <- NULL
model_results5[[3]] <- NULL

model_results5 <- model_results5 %>% 
  bind_rows() %>% 
  mutate(outcome = 'Gun Control Petition', petition = "Physicians Demand Stricter Gun Control") %>% 
  remove_rownames()

out <- bind_rows(model_results, model_results2, model_results3, model_results4,model_results5)
write_csv(out, file='datasets/rdit_petitions_meta.csv')

out <- read_csv('datasets/rdit_petitions_meta.csv')
missing <- allshootings %>%
  filter(!shooting %in% out$shooting & include==1) %>%
  pull(shooting)
out <- out %>%
  mutate(shooting = factor(shooting, levels=rev(c(
    allshootings$shooting
  )))) %>%
  mutate(sig = ifelse((lower < 0 & upper < 0) | (lower > 0 & upper > 0),1,0))
out$se <- (out$upper - out$Coef)/1.96

calcMeta <- function(data, name, outcome, petition){
  m.gen <- metagen(TE = Coef,
                   seTE = se,
                   studlab = shooting,
                   data = data,
                   sm = "SMD",
                   fixed = FALSE,
                   random = TRUE)
  results <- tibble(shooting = name, 
                    Coef = m.gen$TE.random,
                    lower = m.gen$lower.random,
                    upper = m.gen$upper.random,
                    outcome = outcome,
                    petition=petition)
  return(results)
}

top10 <- allshootings$shooting[allshootings$top10==1]
out <- out %>%
  bind_rows(calcMeta(out[out$outcome == 'Gun Control Petition',], 'Meta Estimate (Top 20)','Gun Control Petition','Meta Analysis'),
            calcMeta(out[out$outcome == 'Gun Control Petition' & out$shooting %in% top10,], 'Meta Estimate (Top 10)','Gun Control Petition','Meta Analysis'),
            calcMeta(out[out$outcome == 'Gun Rights Petition',], 'Meta Estimate (Top 20)','Gun Rights Petition','Meta Analysis'),
            calcMeta(out[out$outcome == 'Gun Rights Petition' & out$shooting %in% top10,], 'Meta Estimate (Top 10)','Gun Rights Petition','Meta Analysis')) 

####
# Meta analyses by race of victims
#### 

race_est <- read_csv('datasets/shooting_race.csv')
race_est <- race_est %>%
  filter(shooting %in% out$shooting)
terciles <- quantile(race_est$mean.white, na.rm=T, c(0,0.33,0.66,1))
race_est$tercile <- ifelse(race_est$mean.white < terciles[2],1,0)
race_est$tercile <- ifelse(race_est$mean.white > terciles[2] & race_est$mean.white < terciles[3],2,race_est$tercile)
race_est$tercile <- ifelse(race_est$mean.white > terciles[3],3,race_est$tercile)
datnew <- left_join(out %>%
                      filter(petition != 'Meta Analysis'), 
                    race_est, by='shooting')

meta_top3 <- calcMeta(datnew %>% 
                        mutate(se = (upper - Coef)/1.96) %>% 
                        filter(tercile == 3 & outcome == 'Gun Control Petition'),  
                      'Meta Estimate (Top)','Meta Analysis Estimate','Meta Analysis')
meta_top2 <- calcMeta(datnew %>% 
                        mutate(se = (upper - Coef)/1.96) %>% 
                        filter(tercile == 2 & outcome == 'Gun Control Petition'),  
                      'Meta Estimate (Middle)','Meta Analysis Estimate','Meta Analysis')
meta_top1 <- calcMeta(datnew %>% 
                        mutate(se = (upper - Coef)/1.96) %>% 
                        filter(tercile == 1  & outcome == 'Gun Control Petition'),  
                      'Meta Estimate (Lower)','Meta Analysis Estimate','Meta Analysis')
meta_tercile_guncontrol <- bind_rows(meta_top3, meta_top2, meta_top1) %>%
  mutate(category = 'Petition', z = 'Gun Control')

meta_top3 <- calcMeta(datnew %>% 
                        mutate(se = (upper - Coef)/1.96) %>% 
                        filter(tercile == 3 & outcome == 'Gun Rights Petition'),  
                      'Meta Estimate (Top)','Meta Analysis Estimate','Meta Analysis')
meta_top2 <- calcMeta(datnew %>% 
                        mutate(se = (upper - Coef)/1.96) %>% 
                        filter(tercile == 2 & outcome == 'Gun Rights Petition'),  
                      'Meta Estimate (Middle)','Meta Analysis Estimate','Meta Analysis')
meta_top1 <- calcMeta(datnew %>% 
                        mutate(se = (upper - Coef)/1.96) %>% 
                        filter(tercile == 1  & outcome == 'Gun Rights Petition'),  
                      'Meta Estimate (Lower)','Meta Analysis Estimate','Meta Analysis')
meta_tercile_gunrights <- bind_rows(meta_top3, meta_top2, meta_top1) %>%
  mutate(category = 'Petition', z = 'Gun Rights')

dat.out <- bind_rows(meta_tercile_guncontrol, meta_tercile_gunrights)
write_csv(dat.out, 'datasets/metaanalysis/meta_race_petition.csv' )

# read in new meta data for bottom 20 ----
bottom20 <- read_csv('datasets/lower_20_petition.csv')
bottom20$shooting <- 'Meta Estimate (Bottom 20)'
out <- bind_rows(out, bottom20)

out$shooting <- factor(out$shooting, levels=rev(c(
  c(allshootings$shooting, 'Meta Estimate (Top 10)','Meta Estimate (Top 20)', 'Meta Estimate (Bottom 20)')
)))

out %>%
  filter(petition == "Meta Analysis") %>%
  mutate(z = 'All Petitions') %>%
  write_csv(file='datasets/metaanalysis/meta_petitions_all.csv')

uniqueshootings <- allshootings$shooting[allshootings$include==1]
missingcases <- data.frame(
  shooting = uniqueshootings[!uniqueshootings %in% out$shooting],
  outcome = 'Gun Control Petition',
  Coef = NA, lower = NA, upper = NA, petition = NA, sig=NA, se=NA
)
plot <- out %>%
  bind_rows(missingcases) %>%
  mutate(shooting = factor(shooting, levels=rev(
    c(allshootings$shooting,'Meta Estimate (Top 10)','Meta Estimate (Top 20)','Meta Estimate (Bottom 20)')))) %>%
  mutate(sig = ifelse((lower < 0 & upper < 0) | (lower > 0 & upper > 0),1,0)) %>%
  mutate(petition = factor(petition,levels=c(
    'Common Sense Gun Control',
    'Walmart Guns',
    'Physicians Demand Stricter Gun Control',
    "Patriot's Voice",
    'Maryland Gun Laws',
    'Meta Analysis'
  ))) %>%
  ggplot(aes(shooting, y=Coef, ymin=lower, ymax=upper, shape=petition, color=factor(sig))) +
  coord_flip() +
  geom_hline(yintercept=0, linetype=2, color='red') +
  labs(y='Effect on Gun Control\nPetition Signatures\n(Standard Deviations)',x='', title='')+
  theme_bw() + 
  geom_errorbar(width=0, position=position_dodge(width=.75)) +
  geom_point(position=position_dodge(width=.75), size=3, fill='white') +
  facet_wrap(~outcome) +
  scale_shape_manual(values=c(21, 22, 23, 24, 25, 20), name='', na.translate=F) +
  scale_color_manual(values=c('Grey50',"Black"), guide='none') +
  theme(plot.title = element_text(hjust = 0.5)) 
plot
ggsave(plot, width=10, height=5, filename = 'figures/petition_signatures.png')

# lower 20

rm(list=ls())

pacman::p_load(lubridate, tidyverse, haven, gtrendsR, rdrobust, rddtools,
               broom, ggpubr, gridExtra, dmetar, meta)

# shootings
allshootings <- read_csv('datasets/list_of_shootings.csv',col_select = 1:4)
allshootings$date <- mdy(allshootings$date)

# change petition
df <- read_csv('datasets/change_petition_anisha.csv')
df$date <- lubridate::mdy(df$date)
df <- df %>% filter(country == 'US')

# date range
mindate <- min(df$date) + months(2)
maxdate <- max(df$date) - months(2)
dates <- allshootings %>%
  filter(date >= mindate & date <= maxdate & include==0)

grouped <- df %>%
  group_by(date) %>%
  count() 
grouped <- right_join(grouped, data.frame(date=seq(min(grouped$date), max(grouped$date),by='day')))

dat <- vector('list', nrow(dates))
for(i in 1:length(dat)){
  dat[[i]] <- grouped %>%
    filter(date > dates$date[i] - months(2) & date < dates$date[i] + months(2)) %>%
    mutate(running_day = as.numeric(date - dates$date[i])) 
}

runRdit <- function(out, name){
  sd_est <- sd(out$n,na.rm=T)
  house_rdd <- rdd_data(y=out$n, x=out$running_day, cutpoint=0)
  bw_ik <- rdd_bw_ik(house_rdd)
  reg_nonpara <- rdd_reg_np(rdd_object=house_rdd, bw=bw_ik)
  fullest <- data.frame(Coef=reg_nonpara$coefficients/sd_est,
                        lower=(reg_nonpara$coefficients - 1.96 * reg_nonpara$coefMat[2])/sd_est,
                        upper=(reg_nonpara$coefficients + 1.96 * reg_nonpara$coefMat[2])/sd_est,
                        shooting=name)
  return(fullest)
}

model_results <- vector('list', nrow(dates))
for(i in 1:length(model_results)){
  model_results[[i]] <- runRdit(dat[[i]], dates$shooting[[i]])
}
model_results <- bind_rows(model_results) %>% 
  mutate(outcome = 'Gun Control Petition', petition = 'Common Sense Gun Control') %>%
  remove_rownames()

df <- read_csv('datasets/md_petition.csv')
df$date <- lubridate::mdy(df$date)
df <- df %>% filter(country == 'US')

df <- df %>%
  group_by(date) %>%
  count()
df <- right_join(df, data.frame(date=seq(min(df$date), max(df$date), by='day')))
df$n[is.na(df$n)] <- 0

mindate <- min(df$date) + months(2)
maxdate <- max(df$date) - months(2)
dates <- allshootings %>%
  filter(date >= mindate & date <= maxdate & include==0)

dat <- vector('list', nrow(dates))
for(i in 1:length(dat)){
  dat[[i]] <- df %>%
    filter(date > dates$date[i] - months(2) & date < dates$date[i] + months(2)) %>%
    mutate(running_day = as.numeric(date - dates$date[i])) 
}

model_results2 <- vector('list', nrow(dates))
for(i in 1:length(model_results2)){
  model_results2[[i]] <- runRdit(dat[[i]], dates$shooting[[i]])
}
model_results2 <- bind_rows(model_results2) %>% 
  mutate(outcome = 'Gun Rights Petition', petition = 'Maryland Gun Laws') %>%
  remove_rownames()

df <- read_csv('datasets/change_petition_walmart.csv')
df$date <- lubridate::mdy(df$date)
df <- df %>% filter(country == 'US')

df <- df %>%
  group_by(date) %>%
  count() 
df <- right_join(df, data.frame(date=seq(min(df$date), max(df$date),by='day')))

mindate <- min(df$date) + months(2)
maxdate <- max(df$date) - months(2)
dates <- allshootings %>%
  filter(date >= mindate & date <= maxdate & include==0)

dat <- vector('list', nrow(dates))
for(i in 1:length(dat)){
  dat[[i]] <- df %>%
    filter(date > dates$date[i] - months(2) & date < dates$date[i] + months(2)) %>%
    mutate(running_day = as.numeric(date - dates$date[i])) 
}

model_results3 <- vector('list', nrow(dates))
for(i in 1:length(model_results3)){
  model_results3[[i]] <- runRdit(dat[[i]], dates$shooting[[i]])
}
model_results3 <- bind_rows(model_results3) %>% 
  mutate(outcome = 'Gun Control Petition', petition = 'Walmart Guns') %>% 
  remove_rownames()

# Gun rights 2 ----
df <- read_csv('datasets/signatures_patriot_voices.csv')
df %>%
  group_by(signature) %>%
  count() %>%
  ggplot(aes(signature,n)) +
  geom_line()

df <- df %>%
  group_by(signature) %>%
  count() %>%
  rename(date = signature)
df <- right_join(df, data.frame(date=seq(min(df$date), max(df$date),by='day')))
df$n[is.na(df$n)] <- 0

mindate <- min(df$date) + months(2)
maxdate <- max(df$date) - months(2)
dates <- allshootings %>%
  filter(date >= mindate & date <= maxdate & include==0)

dat <- vector('list', nrow(dates))
for(i in 1:length(dat)){
  dat[[i]] <- df %>%
    filter(date > dates$date[i] - months(2) & date < dates$date[i] + months(2)) %>%
    mutate(running_day = as.numeric(date - dates$date[i])) 
}
vals = c(1,3,4,5)
model_results4 <- vector('list', length(vals))
for(i in 1:length(model_results4)){
  model_results4[[vals[i]]] <- runRdit(dat[[vals[i]]], dates$shooting[[vals[i]]])
}

model_results4 <- bind_rows(model_results4) %>% 
  mutate(outcome = 'Gun Rights Petition', petition = "Patriot's Voice") %>% 
  remove_rownames()

# Physicians for gun control ----
df <- readxl::read_excel('datasets/petition_signatures_emma taylor.xlsx')
df <- janitor::clean_names(df)
df$date <- ymd(df$signed_on)
df <- df %>% filter(country == 'US')
df <- df %>%
  dplyr::select(date) %>%
  group_by(date) %>%
  count()

date_range <- range(df$date, na.rm=T)

formerge <- expand.grid(date=seq(date_range[1],date_range[2], by='day'))
df <- left_join(formerge, df, by=c('date'))
df$n[is.na(df$n)] <- 0

mindate <- min(df$date) + months(2)
maxdate <- max(df$date) - months(2)
dates <- allshootings %>%
  filter(date >= mindate & date <= maxdate & include==0)

dat_out <- vector('list', nrow(dates))

for(i in 1:nrow(dates)){
  dat_out[[i]] <- df %>%
    filter(date > dates$date[i] - months(2) & date < dates$date[i] + months(2)) %>%
    mutate(running_day = as.numeric(date - dates$date[i]))
  print(i)
}
model_results5 <- vector('list',length(dates$shooting))
for(i in 1:length(dates$shooting)){
  model_results5[[i]] <- tryCatch({runRdit(dat_out[[i]], dates$shooting[[i]])}, 
                                  error=function(e){return(NA)})
  print(i)
}
model_results5[[3]] <- NULL
model_results5 <- model_results5 %>% 
  bind_rows() %>% 
  mutate(outcome = 'Gun Control Petition', petition = "Physicians Demand Stricter Gun Control") %>% 
  remove_rownames()

out <- bind_rows(model_results, model_results2, model_results3, model_results4, model_results5)
#write_csv(out, file='datasets/rdit_petitions_meta.csv')

missing <- allshootings %>%
  filter(!shooting %in% out$shooting & include==0) %>%
  pull(shooting)
out <- out %>%
  bind_rows(tibble(Coef = NA, lower=NA, upper=NA, shooting = missing, outcome = 'Gun Control Petition',petition='Common Sense Gun Control')) %>%
  mutate(shooting = factor(shooting, levels=rev(c(
    allshootings$shooting
  )))) %>%
  mutate(sig = ifelse((lower < 0 & upper < 0) | (lower > 0 & upper > 0),1,0))
out$se <- (out$upper - out$Coef)/1.96

calcMeta <- function(data, name, outcome, petition){
  m.gen <- metagen(TE = Coef,
                   seTE = se,
                   studlab = shooting,
                   data = data,
                   sm = "SMD",
                   fixed = FALSE,
                   random = TRUE)
  results <- tibble(shooting = name, 
                    Coef = m.gen$TE.random,
                    lower = m.gen$lower.random,
                    upper = m.gen$upper.random,
                    outcome = outcome,
                    petition=petition)
  return(results)
}

out <- out %>%
  bind_rows(calcMeta(out[out$outcome == 'Gun Control Petition',], 'Meta Estimate (All)','Gun Control Petition','Meta Analysis'),
            calcMeta(out[out$outcome == 'Gun Rights Petition',], 'Meta Estimate (All)','Gun Rights Petition','Meta Analysis'))
out$shooting <- factor(out$shooting, levels=rev(c(
  c(allshootings$shooting, 'Meta Estimate (All)','Meta Estimate (Top 10)')
)))

metaestimates <- bind_rows(calcMeta(out[out$outcome == 'Gun Control Petition',], 'Meta Estimate (All)','Gun Control Petition','Meta Analysis'),
          calcMeta(out[out$outcome == 'Gun Rights Petition',], 'Meta Estimate (All)','Gun Rights Petition','Meta Analysis'))
write_csv(metaestimates, 
          file = 'datasets/lower_20_petition.csv')

plot <- out %>%
  mutate(sig = ifelse((lower < 0 & upper < 0) | (lower > 0 & upper > 0),1,0)) %>%
  mutate(petition = factor(petition,levels=c(
    'Common Sense Gun Control',
    'Walmart Guns',
    "Patriot's Voice",
    'Maryland Gun Laws',
    'Physicians Demand Stricter Gun Control',
    'Meta Analysis'
  ))) %>%
  ggplot(aes(shooting, y=Coef, ymin=lower, ymax=upper, shape=petition, color=factor(sig))) +
  coord_flip() +
  geom_hline(yintercept=0, linetype=2, color='red') +
  labs(y='Effect on Gun Control\nPetition Signatures\n(Standard Deviations)',x='', title='(A) Petitions')+
  theme_bw() + 
  geom_errorbar(width=0, position=position_dodge(width=.75)) +
  geom_point(position=position_dodge(width=.75), size=3, fill='white') +
  facet_wrap(~outcome) +
  scale_shape_manual(values=c(21, 22, 23, 24, 20, 25), name='') +
  scale_color_manual(values=c('Grey50',"Black"), guide='none') +
  theme(plot.title = element_text(hjust = 0.5)) 
ggsave(plot, width=10, height=5, filename = 'figures/petition_signatures_low_attn.png')

